<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0041)http://www.ewebvn.com/demo/div-three-col/ -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" href="../source/galaryshow/css/galleriffic-2.css" type="text/css" />
		<script type="text/javascript" src="../source/galaryshow/js/jquery-1.3.2.js"></script>
		<script type="text/javascript" src="../source/galaryshow/js/jquery.galleriffic.js"></script>
		<script type="text/javascript" src="../source/galaryshow/js/jquery.opacityrollover.js"></script>
        <link rel="stylesheet" href="../source/resizeimg/jquery.nailthumb.1.1.css" type="text/css" />
        <script type="text/javascript" src="../source/resizeimg/jquery.nailthumb.1.1.js"></script>
                                    
		<!-- We only want the thunbnails to display when javascript is disabled -->
		<script type="text/javascript">
			document.write('<style>.noscript { display: none; }</style>');
		</script>
        <style type="text/css" media="screen">
                .square {
                    width: 75px;
                    height: 75px;
                }
                .showlink {
                    width: 690px;
                    height: 500px;
                }
                 </style>
                  
</head>

<?php

    function list_files($directory)
    {
        if ($directory != '.')
        {
            $directory = rtrim($directory, '/') . '/';
        }
        
        if ($handle = opendir($directory))
        {
            while (false !== ($file = readdir($handle)))
            {
                if ($file != '.' && $file != '..')
                {
                    echo	'<li>
                                <a class="thumb" name="leaf" href="'.$directory.$file.'" title="Title #0">
                                <img class="nailthumb-container square" src="'.$directory.$file.'" alt="Title #0" />
							</a>
                                <div class="caption">
    								<div class="download">
    									<a href="download.php?file='.$directory.$file.'" class="btn">Tải Ảnh Gốc</a>
    								</div>
							     </div>
                            </li>';
                }
            }
            
            closedir($handle);
        }
    }
?>

		<div id="page">
			<div id="container">
				<h2>Bộ Sưu Tập Ảnh Cưới</h2>
				<!-- Start Advanced Gallery Html Containers -->
				<div id="gallery" class="content">
					<div id="controls" class="controls"></div>
					<div class="slideshow-container">
						<div id="loading" class="loader"></div>
						<div id="slideshow" class="slideshow"></div>
					</div>
					<div id="caption" class="caption-container"></div>
				</div>
				<div id="thumbs" class="navigation">
					<ul class="thumbs noscript">
                        <?php list_files('../upload/anhembe');?>
					</ul>
				</div>
			</div>
		</div>
		<script type="text/javascript">
			jQuery(document).ready(function($) {
				// We only want these styles applied when javascript is enabled
				$('div.navigation').css({'width' : '300px', 'float' : 'left'});
				$('div.content').css('display', 'block');

				// Initially set opacity on thumbs and add
				// additional styling for hover effect on thumbs
				var onMouseOutOpacity = 0.67;
				$('#thumbs ul.thumbs li').opacityrollover({
					mouseOutOpacity:   onMouseOutOpacity,
					mouseOverOpacity:  1.0,
					fadeSpeed:         'fast',
					exemptionSelector: '.selected'
				});
				
				// Initialize Advanced Galleriffic Gallery
				var gallery = $('#thumbs').galleriffic({
					delay:                     2500,
					numThumbs:                 15,
					preloadAhead:              10,
					enableTopPager:            true,
					enableBottomPager:         true,
					maxPagesToShow:            7,
					imageContainerSel:         '#slideshow',
					controlsContainerSel:      '#controls',
					captionContainerSel:       '#caption',
					loadingContainerSel:       '#loading',
					renderSSControls:          true,
					renderNavControls:         true,
					playLinkText:              'Tự Động Trình Chiếu',
					pauseLinkText:             'Dừng',
					prevLinkText:              '&lsaquo; Ảnh Trước',
					nextLinkText:              'Ảnh Sau &rsaquo;',
					nextPageLinkText:          'Trang Sau &rsaquo;',
					prevPageLinkText:          '&lsaquo; Trang Trước',
					enableHistory:             false,
					autoStart:                 false,
					syncTransitions:           true,
					defaultTransitionDuration: 900,
					onSlideChange:             function(prevIndex, nextIndex) {
						// 'this' refers to the gallery, which is an extension of $('#thumbs')
						this.find('ul.thumbs').children()
							.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
							.eq(nextIndex).fadeTo('fast', 1.0);
					},
					onPageTransitionOut:       function(callback) {
						this.fadeTo('fast', 0.0, callback);
					},
					onPageTransitionIn:        function() {
						this.fadeTo('fast', 1.0);
					}
				});
			});
		</script>